﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="StyleCopViolationTokenFactory.cs" company="StyleCop for ReSharper Development Team">
//   Copyright (c) StyleCop for ReSharper Development Team. All rights reserved.
// </copyright>
// <summary>
//   Defines the StyleCopViolationTokenFactory type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace StyleCop.For.ReSharper.Violations
{
    #region Using Directives

    using Microsoft.StyleCop.CSharp;

    #endregion

    /// <summary>
    /// Factory class for getting HighLights for StyleCop violations.
    /// </summary>
    public static class StyleCopViolationTokenFactory
    {
        #region Public Methods

        /// <summary>
        /// Gets the <see cref="CsTokenType"/> for the specified StyleCop Violation.
        /// </summary>
        /// <param name="checkId">
        /// Rule check id of violation.
        /// </param>
        /// <returns>
        /// An <see cref="CsTokenType"/> for the specified check id.
        /// </returns>
        public static CsTokenType? GetTokenType(string checkId)
        {
            switch (checkId)
            {
                case "SA1007":
                    return CsTokenType.Operator;
                case "SA1008":
                    return CsTokenType.OpenParenthesis;
                case "SA1009":
                    return CsTokenType.CloseParenthesis;
                case "SA1010":
                    return CsTokenType.OpenSquareBracket;
                case "SA1011":
                    return CsTokenType.CloseSquareBracket;
                case "SA1012":
                    return CsTokenType.OpenCurlyBracket;
                case "SA1013":
                    return CsTokenType.CloseCurlyBracket;
                case "SA1016":
                    return CsTokenType.OpenAttributeBracket;
                case "SA1017":
                    return CsTokenType.CloseAttributeBracket;
                case "SA1024":
                    return CsTokenType.LabelColon;
                default:
                    return null;
            }
        }

        #endregion
    }
}